#ifndef OXFORD3000TASK_H
#define OXFORD3000TASK_H

#include "task.h"
#include "oxford-word.h"

namespace Oxford
{

class Task : public QObject, public Core::ITask
{
    Q_OBJECT
public:
    enum TaskType { WordFromDefinition = 0, WordInSentenceFromDefinition = 1, IdiomFromDefinition = 2, IdiomInSentenceFromDefinition = 3 };
private:
    Word _word;

    TaskType _type;
    QString _definition;
    QString _sentence;
    QString _answer;

    QObject* _receiver;
    QString _answerSlot;

    void _initialize();

    void _generateWordFromDefinitionTask();
    void _generateWordInSentenceFromDefinitionTask();
    void _generateIdiomFromDefinitionTask();
    void _generateIdiomInSentenceFromDefinitionTask();
public:
    Task(const Word& word);

    virtual void draw(QWidget* parent, QObject* receiver, const char* answeredSlot);

private slots:
    void checkAnswer();
};

}

#endif // OXFORD3000TASK_H
